package com.kucun.service.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kucun.Dao.GoodsMapper;
import com.kucun.Dao.RepertoryMapper;
import com.kucun.bean.Goods;
import com.kucun.bean.Page;
import com.kucun.bean.Repertory;
import com.kucun.service.GoodsService;
import com.kucun.service.RepertoryService;

@Service
@Transactional 
public class RepertoryServiceImp implements RepertoryService {

	@Resource
	private RepertoryMapper repertoryMapper;
	public int save(Repertory record) {
		return repertoryMapper.insertSelective(record);
	}

	public boolean update(Repertory record) {
		return repertoryMapper.updateByPrimaryKey(record);
	}

	public boolean delete(String userid) {
		return repertoryMapper.deleteByPrimaryKey(userid);
	}


	public Repertory findById(int userid) {
		return repertoryMapper.selectByPrimaryKey(userid);
	}


	public List<Repertory> findAll(Page page){
          return repertoryMapper.findAll(page);
	}

	public Page getCount() {
		
		return repertoryMapper.getCount();
	}

	public int updateGoodsForDel(String ids) {
		return repertoryMapper.updateGoodsForDel(ids);
	}

	public Integer updateByPrimaryKeySelective(Repertory re) {
		return repertoryMapper.updateByPrimaryKeySelective(re);
	}

	public int delRepertoryForDel(String ids) {
		
		return repertoryMapper.delRepertoryForDel(ids);
	}

	public List<Repertory> findAllDateNoPaging() {
		
		return repertoryMapper.findAllDateNoPaging();
	}

	public boolean deleteTreeByPrimaryKey(Integer id) {
		
		return repertoryMapper.deleteTreeByPrimaryKey(id);
	}

}
